package com.kaifamiao.demo.d0721;

import java.util.Arrays;

public class Demo10 {

    public static void main(String[] args) {
        int[] arr = {2, 4, 1, -1, 0, 9, 1, 7, 22};

        // 升序
//        Arrays.sort(arr);
        Arrays.parallelSort(arr);

        String str = Arrays.toString(arr);
        System.out.println(str);
//        for(int i = 0; i < arr.length; i ++){
//            System.out.println(arr[i]);
//        }

        int index = Arrays.binarySearch(arr, 4);
        System.out.println(index);
    }
}
